package com.intellekt.ecert.importacion.action;

import java.util.Map;
import static com.intellekt.ecert.domain.Constantes.USUARIO;
import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.interceptor.SessionAware;

import com.intellekt.ecert.domain.DomainActionSupport;
import com.intellekt.ecert.domain.UsuarioVO;

@Results( { @Result(name = "input", location = "importacion", type = "tiles") })
public class ImportacionAction extends DomainActionSupport implements SessionAware {

    /**
     * 
     */
    private static final long serialVersionUID = -1915779054202062140L;
    private static final Logger log = Logger.getLogger(ImportacionAction.class);
    
    protected Map<String, Object> session;
    
    public void setSession(Map<String, Object> session) {
        this.session = session;
    }

    @Override
    public String input() throws Exception {
        if (log.isInfoEnabled()) {
            log.info("input Parametros...");
        }
        
        String verify = verificar(this.getActionId(), (UsuarioVO) session.get(USUARIO));
        if (verify != null) {
            return verify;
        }
        
        return INPUT;
    }
    
    @Override
    public String getActionId() {
        return "importacion";
    }

}
